<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>표준원산지관리시스템:::판정 및 인증서발행:::판정이력조회</title>
<link rel="stylesheet" type="text/css" href="<c:url value='/css/common.css'/>" media="all" />
<script src="/oms/javascript/common.js" language="Javascript"></script>
<script type="text/JavaScript">
	<!--
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	//-->
	function fn_search() {
		var form = document.forms['formOms30'];
		form.action="<c:url value='/judgment/judg_select.do'/>";
		form.submit();
	}
	

	function fn_confirmation(){
        	
		var form = document.forms['formOms30'];
        
		if (fn_nocheck(form.idx)) {
            alert("확인서 출력할 항목을 선택하십시오.");
            return;
        }

       	form.target="_blank";
		form.action="<c:url value='/judgment/form13.do'/>";
		form.submit();	

        form.target = "_self";
	}
    
	function fn_certificate(){
		
	}
	function fn_somyeongseo(){
		
	}
	function fn_selectAllorNot(obj) {
		var decisionNum = document.getElementsByName("idx");
		var allcheck = obj.checked;
		for ( var i = 0; i < decisionNum.length; i++) {
			decisionNum[i].checked = allcheck;
		}
	}

	function fn_linkPage(page) {
		var form = document.forms['formOms30'];
		form.action="<c:url value='/judgment/judg_select.do'/>";
		form.pageIndex.value = page;
		form.submit();	
	}
</script>
</head>
<body onload="MM_preloadImages('<%=request.getContextPath()%>/images/tab_on_01.jpg','<%=request.getContextPath()%>/images/tab_on_02.jpg','<%=request.getContextPath()%>/images/tab_on_03.jpg')">

<!-- 바로가기 메뉴 -->
<div class="accessibility">
	<ul>
		<li><a href="#mainNav">주메뉴바로가기</a></li>
		<li><a href="#subMenu">서브메뉴바로가기</a></li>
		<li><a href="sub_contents">콘텐츠바로가기</a></li>		
	</ul>
</div>

<!-- top 영역 시작 -->
<div id="top">
	<!-- 로그인 사용자정보 시작 -->
	<%@include file="/WEB-INF/jsp/oms/include/userinfo.jsp" %>
	<!-- 로그인 사용자정보 끝 -->
</div>
<!-- top 영역 끝 -->

<!-- 왼쪽영역 시작 -->
<div id="left">
	<!-- 왼쪽메뉴 시작 -->
	<%@include file="/WEB-INF/jsp/oms/include/leftmenu.jsp" %>
	<!-- 왼쪽메뉴 끝 -->
	<!-- 대쉬보드 시작-->
	<%@include file="/WEB-INF/jsp/oms/include/dashboard.jsp" %>	
	<!-- 대쉬보드 끝-->

</div>
<!-- 왼쪽영역 끝 -->


<!-- 콘텐츠 영역 시작 -->
<div id="container">
	<h3 class="tit"><span><strong>판정이력정보</strong></span></h3>
	<!-- 콘텐츠 감싸기 시작 -->
	<div id="contents">
		<div class="governing">
		원산지 판정을 위한 협정을 관리합니다.<br />
		협정을 선택하여 적용, 미적용을 적용함으로써 원산지 판정적용 여부를 결정할 수 있습니다.
		</div>	
		<br />
		<br />

	
	<!-- 데이터 테이블 시작 -->
	<div id="data">
	<form name="formOms30" method="post">
		<input type="hidden" name="pageIndex" value="${juSearchVO.pageIndex}"/>
		<!-- Part No 조회영역 시작 -->
		<div class="search">
			<table cellpadding="0" cellspacing="0" class="topline">
				<colgroup>
					<col width="20%" />
					<col width="*" />
				</colgroup>
				<tr>
					<th class="thC">Part No.</th>
					<td class="tdGrayL"><label>
						<input class="input" type="text" name="partNo" value="${juSearchVO.partNo}" />
					</label></td>
					<th class="thC">협정</th>
					<td class="tdGrayL"><label>
						<input class="input" type="text" name="agreeCd" value="${juSearchVO.agreeCd}" />
					</label></td>
				</tr>
				<tr>
					<th class="thC">충족여부</th>
					<td class="tdGrayL"><label>
						<select name="satisfy">
						   <option value="B" <c:if test="${juSearchVO.satisfy == 'B'}">selected="selected"</c:if>>미판정</option>
						   <option value="S" <c:if test="${juSearchVO.satisfy == 'S'}">selected="selected"</c:if>>충족</option>
						   <option value="F" <c:if test="${juSearchVO.satisfy == 'F'}">selected="selected"</c:if>>불충족</option>
						</select>
					</label></td>
					<th class="thC">판정일자</th>
					<td class="tdGrayL"><label>
						<input class="input" type="text" name="date" value="${juSearchVO.judgmentDate}" />
					</label></td>
				</tr>
			</table>
			<div class="btnR">
				<a href="#" onclick="fn_search()"><img src="<%=request.getContextPath()%>/images/btn/btn_view.jpg" alt="조회" border="0" /></a> 
			</div>
		</div>
		<!-- Part No 조회영역 끝 -->
		<br /><br />
		
		<table cellpadding="0" cellspacing="0" class="topline">
			<colgroup>
				<col width="10%" />
				<col width="15%" />
				<col width="15%" />
				<col width="15%" />
				<col width="15%" />
				<col width="15%" />
				<col width="15%" />
			</colgroup>
			<tr>
				<th class="thC"><input type="checkbox" id="check" onclick="fn_selectAllorNot(this);"/></th>
				<th class="thC">PartNo.</th>
				<th class="thC">공급처PartNo.</th>
				<th class="thC">협정</th>
				<th class="thC">판가</th>
				<th class="thC">적용기준</th>
				<th class="thC">충족여부</th>
			</tr>
		 	<c:forEach var="judg" items="${judg}" varStatus="status">
			<tr>
				<td class="tdGrayC"><input type="checkbox" name="idx" value="${status.index}"/></td>
				<td class="tdGrayC"><c:out value="${judg.goodPartNo}"/></td>
				<td class="tdGrayC"><c:out value="${judg.delivPartNo}"/></td>
				<td class="tdGrayC"><c:out value="${judg.id}"/></td>
				<td class="tdGrayC"><c:out value="${judg.goodPrice}"/></td>
				<td class="tdGrayC"><c:out value="${judg.origRule}"/></td>
				<td class="tdGrayC">
                    <input type="hidden" name="delivPartNo" value="${judg.delivPartNo}" />
                    <input type="hidden" name="agreeCdNm" value="${judg.id}" />
                    <input type="hidden" name="hscd" value="${judg.hscd}" />
                    <input type="hidden" name="origRule" value="${judg.origRule}" />
                    <input type="hidden" name="satiYN" value="${judg.satiYN}" />
				<c:if test="${judg.satiYN == 'B'}">
				   미판정
				</c:if>
				<c:if test="${judg.satiYN == 'F'}">
				   불충족
				</c:if>
				<c:if test="${judg.satiYN == 'S'}">
				   충족
				</c:if></td>
			</tr>
			</c:forEach>
			<c:if test="${fn:length(judg) == 0}">
				<tr>
					<td colspan="7" class="tdGrayC">해당내역이 존재하지 않습니다.</td>
				</tr>
			</c:if>
		</table>
        <br /><br />
        
        <!-- 왼쪽정렬 버튼 시작 -->
		<div class="btnL">
			<ul>
				<li><a href="#" onclick="fn_confirmation()"><img src="<%=request.getContextPath()%>/images/btn/btn_confirmation.jpg" alt="확인서 작성" /></a></li>
			</ul>
		</div>
		<!-- 왼쪽정렬 버튼 끝 -->
	</form>
	<!-- 페이징 시작 -->
	<div class="paginate"><ui:pagination paginationInfo = "${paginationInfo}" jsFunction="fn_linkPage"/></div>
	<!-- 페이징 끝 -->
	</div>
	<!-- 데이터 테이블 끝 -->

	</div>
	<!-- 콘텐츠 감싸기 시작 -->
</div>
<!-- 콘텐츠 영역 끝 -->
</body>
</html>
<!-- img src="/images/btn/btn_certificate.jpg" alt="증명서 작성" / -->
<!-- img src="/images/btn/btn_somyeongseo.jpg" alt="소명서 작성" / -->